package com.pn.controller;

import com.pn.entity.Auth;
import com.pn.service.RoleService;
import com.pn.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/auth")
public class AuthInfoController {
    @Autowired
    private RoleService roleService;

    //获取权限列表
    @GetMapping("/auth-tree")
    public Result roleAuthTree(){
        List<Auth> list =  roleService.roleAuthTree();
        return Result.ok(list);
    }


}
